namespace SmartMathLibrary
{
    /// <summary>
    /// Interface to implement a PolynomialComponent class.
    /// </summary>
    public interface IPolynomialComponent
    {
        /// <summary>
        /// Gets or sets the coefficient of the PolynomialComponent.
        /// </summary>
        /// <value>The coefficient of the PolynomialComponent.</value>
        double Coefficient { get; set; }

        /// <summary>
        /// Gets or sets the exponent of the PolynomialComponent.
        /// </summary>
        /// <value>The exponent of the PolynomialComponent.</value>
        double Exponent { get; set; }

        /// <summary>
        /// Inverts the value of the coefficient.
        /// </summary>
        void InvertCoefficient();

        /// <summary>
        /// Inverts the value of the exponent.
        /// </summary>
        void InvertExponent();

        /// <summary>
        /// Adds a coefficient value from another PolynomialComponent to the current coefficient.
        /// </summary>
        /// <param name="add">The component to add.</param>
        void AddCoefficient(PolynomialComponent add);

        /// <summary>
        /// Calculates the value of the current component with a specified value for x.
        /// </summary>
        /// <param name="x">The value for x.</param>
        /// <returns>The value of the current component with the specified value for x.</returns>
        double CalulateValue(double x);

        /// <summary>
        /// Derivatives the current component.
        /// </summary>
        /// <returns>The derivative of the current component.</returns>
        PolynomialComponent Derivative();

        /// <summary>
        /// Copies the current instance of the component.
        /// </summary>
        /// <returns>The current instance of the component.</returns>
        PolynomialComponent Copy();

        /// <summary>
        /// Compares the current component with another one.
        /// </summary>
        /// <param name="compare">The component to compare.</param>
        /// <returns>True if the components are even otherwise, false.</returns>
        bool CompareTo(PolynomialComponent compare);
    }
}